package com.cci.zkweb.core.entity.p8;

import java.io.Serializable;
import java.util.List;

import com.cci.zkweb.core.util.ZKFUtils;

public class Folder 
extends P8Object 
implements Serializable {
	private static final long serialVersionUID = -8012902537195579988L;
	private String path;

	private List<Folder> subFolders;
	private List<Document> docList;
	private Folder parent;
	
	public Folder() { }

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}
	
	public List<Folder> getChildren() {
        return subFolders;
    }
 
    public void setChildren(List<Folder> children) {
        this.subFolders = children;
    }
    
	public boolean isRoot() {
		return parent == null;
	}

	public Folder getParent() {
		return parent;
	}

	public void setParent(Folder parent) {
		this.parent = parent;
	}

	public List<Document> getDocList() {
		return docList;
	}

	public void setDocList(List<Document> docList) {
		this.docList = docList;
	}

	@Override
	public String getIcon() {
		return String.format(ZKFUtils.ICON_IMAGE_PATH, ZKFUtils.CLOSED_FOLDER_ICON);
	}

	@Override
	public boolean isFolder() {
		return true;
	}
}
